package com.secret.chain.secretchain;

import org.fisco.bcos.sdk.BcosSDK;
import org.fisco.bcos.sdk.client.Client;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.support.ClassPathXmlApplicationContext;

@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
public class SecretChainApplication {


    @Bean
    public Client buildClient(){
        ApplicationContext context =new ClassPathXmlApplicationContext("config.xml");
        BcosSDK bcosSDK = context.getBean(BcosSDK.class);
        return bcosSDK.getClient(1);
    }


    public static void main(String[] args) {
        SpringApplication.run(SecretChainApplication.class,args);
    }

}
